<template>
	<view>
		<!-- 列表 -->
		<view class="u-page">
			<u-list @scrolltolower="scrolltolower">
				<u-list-item v-for="(item, index) in indexList" :key="index">
					<u-cell :title="`处方-${index + 1}`" :isLink="true" arrow-direction="down" value="详情"
						@click="show = true">
						<u-avatar slot="icon" shape="square" size="35" :src="item.url"
							customStyle="margin: -3px 5px -3px 0"></u-avatar>
					</u-cell>
				</u-list-item>
			</u-list>
		</view>
		<!-- 提示 -->
		<u-popup :show="show" mode="bottom" @close="close" @open="open" :closeable="true">
			<view class="">
				<view class="h44">

				</view>
				<u-cell v-for="(item,index) in dList">
					<view slot="title" class="u-slot-title flexflex">
						<view class="mr10 font_b" style="width: 60rpx;">
							{{item.name}}
						</view>
						<view class="text-ellipsis color_84">
							{{item.des}}
						</view>
					</view>
				</u-cell>
				<view class="yesBtn flex-cen margin mt10 ms10" @click="show = false">
					<view class="color_white size_16">
						完成
					</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				indexList: [],
				urls: [
					'https://cdn.uviewui.com/uview/album/1.jpg',
					'https://cdn.uviewui.com/uview/album/2.jpg',
					'https://cdn.uviewui.com/uview/album/3.jpg',
					'https://cdn.uviewui.com/uview/album/4.jpg',
					'https://cdn.uviewui.com/uview/album/5.jpg',
					'https://cdn.uviewui.com/uview/album/6.jpg',
					'https://cdn.uviewui.com/uview/album/7.jpg',
					'https://cdn.uviewui.com/uview/album/8.jpg',
					'https://cdn.uviewui.com/uview/album/9.jpg',
					'https://cdn.uviewui.com/uview/album/10.jpg',
				],
				show: false,
				dList: [{
						name: "组成",
						des: "大黄30g 生姜30g 大白15g"
					},
					{
						name: "功用",
						des: "攻下散瘀，行气止痛"
					},
					{
						name: "加减",
						des: "若局部瘀血肿痛严重者，原方加当归15 g、丹参20 g、乳香15 g、没药15 g；若合并腹胀，大小便不通者，原方加枳壳15 g、厚朴12 g、木通10 g、车前子10 g。若下肢牵掣疼痛严重者，原方加黄芪30 g、地龙12 g、木瓜15 g牛膝10g。"
					},
					{
						name: "功用",
						des: "攻下散瘀，行气止痛"
					},
					{
						name: "主治",
						des: "重症闪扭腰伤，疼痛不能转侧，大便秘结，体质健壮者"
					},
					{
						name: "源流",
						des: "本方为高云峰院长经验方，首载于《正骨学讲义》，《平乐正骨》转载。应用临床效果显著，在河洛地区及平乐正骨学派范围内应用广泛。现临床中多经手法整复胸腰椎关节错缝后，加味应用本方。本方有逐瘀利水作用。类同于西医甘露醇脱水作用"
					},

				]
			};
		},
		onLoad() {
			this.loadmore()
		},
		methods: {
			scrolltolower() {
				this.loadmore()
			},
			loadmore() {
				for (let i = 0; i < 30; i++) {
					this.indexList.push({
						url: this.urls[uni.$u.random(0, this.urls.length - 1)]
					})
				}
			},
			open() {
				// console.log('open');
			},
			close() {
				this.show = false
				// console.log('close');
			}
		},
	}
</script>

<style lang="scss">
	.yesBtn {
		// width: 640rpx;
		height: 90rpx;
		background: #7976E9;
		border-radius: 46rpx 46rpx 46rpx 46rpx;
		opacity: 1;
	}
</style>
